/****************************************************************************************** 
 *	ActionScript JSFL API is under an MIT license.
 *
 *	Copyright (c) 2010 Digital Primates IT Consulting Group
 *
 *	Permission is hereby granted, free of charge, to any person obtaining a copy of this
 *	software and associated documentation files (the "Software"), to deal in the Software 
 *	without restriction, including without limitation the rights to use, copy, modify, 
 *	merge, publish, distribute, sublicense, and/or sell copies of the Software, and to 
 *	permit persons to whom the Software is furnished to do so, subject to the following 
 *	conditions:
 *
 *	The above copyright notice and this permission notice shall be included in all copies
 *	or substantial portions of the Software.
 *
 *	THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, 
 *	INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A 
 *	PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT 
 *	HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF
 *	CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE
 *	OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 
 * 
 *******************************************************************************************/

package flash.extension.panel
{
	import adobe.utils.MMExecute;

	public class OutputPanel
	{
		/**
		 * Saves the contents of the Output Panel to the target file. 
		 * @param fileURI
		 * @param appendToFile
		 * @param useSystemEncoding
		 * 
		 */
		public static function save(fileURI:String, appendToFile:Boolean = false, useSystemEncoding:Boolean = false):void
		{
			MMExecute("fl.outputPanel.save('" + fileURI + "', " + appendToFile + ", " + useSystemEncoding + ")");
		}
		
		/**
		 * Clears the Output Panel. 
		 * 
		 */
		public static function clear():void
		{
			MMExecute("fl.outputPanel.clear()");
		}
		
		/**
		 * Sends a message to the Output Panel.
		 * @param message
		 * 
		 */
		public static function traceMessage( message:String ):void
		{
			MMExecute("fl.outputPanel.trace('"+ message +"')");
		}
	}
}